/*
 * Copyright (c) 2010 CCX(China) Co.,Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * CCX(China) Co.,Ltd. ("Confidential Information").
 * It may not be copied or reproduced in any manner without the express 
 * written permission of CCX(China) Co.,Ltd.
 *
 * Author: zhnb
 * Date: 2011-8-2 上午11:02:04
 */
package com.number.box;

import java.io.Serializable;

import Ice.Communicator;


public class MyBoxServerI implements IceBox.Service, Serializable {
    
    private static final long serialVersionUID = -4451483908319042326L;

    private Ice.ObjectAdapter objAdapter = null;
    
    @Override
    public void start(String name, Communicator communicator, String[] args) {
        this.objAdapter = communicator.createObjectAdapter(name);
        Ice.Object servant = new MyBoxI();
        
        this.objAdapter.add(servant, communicator.stringToIdentity("myBox"));
        this.objAdapter.activate();
        System.out.println(name + " started.");
    }

    @Override
    public void stop() {
        this.objAdapter.deactivate();
    }

}
